/*-
 * Copyright (c) 2009-2010 David Forsythe.
 * See LICENSE file for license details.
 */

#ifndef __LIBPKG_REPOSITORY_INTERNAL_H__
#define __LIBPKG_REPOSITORY_INTERNAL_H__

#include "repository.h"

struct pkg_repository_vtable {
        int (*open) (struct pkg_repository *, const char *, u_int);
        FILE *(*fetch_pkg) (struct pkg_repository *, const char *, char **,
                size_t *,  u_int);
        int (*close) (struct pkg_repository *);
};

struct pkg_repository {
        void *internal;
        unsigned int magic;
        status_t status;
        struct pkg_repository_vtable *vtable;
};

void _pkg_repository_set_vtable(struct pkg_repository *, 
        struct pkg_repository_vtable *);

#endif
